<!DOCTYPE html>
<html lang="zh" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>首页 | 麦克斯仇的博客</title>
    <meta name="Keywords" content="麦克斯仇的博客"/>
    <meta name="Description" content="java,程序员,麦克斯仇,博客"/>
    <th:block th:insert="~{layout :: public_head}">
    </th:block>
</head>
<body>
<th:block th:insert="~{layout :: public_page}">
</th:block>
<div class="main index">
    <div class="search">
        <form class="layui-form" onkeydown="if(event.keyCode==13){return find()}">
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button id="searchBtn" type="button" class="layui-btn"><i class="layui-icon layui-icon-search"></i>
                    </button>
                    <input type="text" name="search" placeholder="开始全文搜索" class="layui-input">
                </div>
            </div>
        </form>
    </div>
    <fieldset class="layui-elem-field layui-field-title">
        <legend>置顶与热门</legend>
    </fieldset>
    <div class="item" th:each="article,articleStat:${list}">
        <p class="time"><i class="layui-icon layui-icon-date"></i>&nbsp;<span th:text="${#temporals.format(article.createTime, 'yyyy/MM/dd')}">2021/01/01</span>&nbsp;&nbsp;&nbsp;<i class="iconfont icon-zhiding" th:if="${article.top}"></i></p>
        <div class="item_title"><a th:href="'/article/detail/' + ${article.id}" href="article/detail/1" th:text="${article.title}">标题</a></div>
        <p><span th:each="name,nameStat:${article.labelNames.split(',')}"><span class="subtitle" th:text="${name}">Nacos</span>&nbsp;&nbsp;</span></p>
        <p class="detail" th:utext="${article.text}">文本</p>
        <p class="praise"><i class="iconfont icon-yanjing"></i><span th:text="${article.view}">105</span></p>
    </div>
    <div class="bei-an">
        <span>&copy;&nbsp;2019-2021&nbsp;maxqiu.com</span><br/>
        <a target="_blank" href="https://beian.miit.gov.cn">苏ICP备17051071号</a><br/>
        <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=32090302000299">
            <img src="/assets/common/img/beian.webp" alt="备案"/>苏公网安备&nbsp;32090302000299号
        </a>
    </div>
    <br/>
</div>
<!-- 右侧内容区域 -->
<div class="right-content">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>L I F E</legend>
    </fieldset>
    <div class="layui-progress layui-progress-big" lay-showpercent="true">
        <em>D</em>
        <div class="layui-progress-bar layui-bg-green" th:lay-percent="${day}"></div>
    </div>
    <div class="layui-progress layui-progress-big" lay-showpercent="true">
        <em>W</em>
        <div class="layui-progress-bar layui-bg-red" th:lay-percent="${week}"></div>
    </div>
    <div class="layui-progress layui-progress-big" lay-showpercent="true">
        <em>M</em>
        <div class="layui-progress-bar layui-bg-blue" th:lay-percent="${month}"></div>
    </div>
    <div class="layui-progress layui-progress-big" lay-showpercent="true">
        <em>Y</em>
        <div class="layui-progress-bar" th:lay-percent="${year}"></div>
    </div>
</div>
<th:block th:insert="~{layout :: public_script}">
</th:block>
<script type="text/javascript">
    /**
     * 单击搜索按钮的时候调用
     */
    $("#searchBtn").click(function () {
        find();
    })

    /**
     * form表单单击回车时调用
     */
    function find() {
        const text = $("input[name='search']").val();
        if (text.length === 0) {
            return false;
        }
        open("https://www.google.com/search?q=site%3Amaxqiu.com%2Farticle%2Fdetail+" + text.replace(" ", "+"))
        return false;
    }

    $(function () {
        $("input[name='search']").focus();
    })
</script>
</body>
</html>
